//
//  BaseTabBarButton.m
//  MoodDiary
//
//  Created by MoodDiary on 2020/11/26.
//

#import "BaseTabBarButton.h"

@implementation BaseTabBarButton

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        self.imageView.contentMode = UIViewContentModeCenter;
        self.titleLabel.textAlignment = NSTextAlignmentCenter;
        self.titleLabel.font = [UIFont systemFontOfSize:12.0];
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    if (DEF_Is_FullScreen) {
        self.imageView.frame = CGRectMake((self.width - 25.0) * 0.5, (30.0 - 25.0) * 0.5 + 6.0, 25.0, 25.0);
        self.titleLabel.frame = CGRectMake(0, self.imageView.bottom, self.width, 20.0);
    } else {
        self.imageView.frame = CGRectMake((self.width - 20.0) * 0.5, (30.0 - 20.0) * 0.5, 20.0, 20.0);
        self.titleLabel.frame = CGRectMake(0, 25.0, self.width, 49.0 - 30.0);
    }
}

@end
